package calao.client.ui;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DeckPanel;

public class Wizard
extends Composite
{

	final DeckPanel panel = new DeckPanel();
		
	public Wizard()
	{
		initWidget(panel);
	}
	
	public void add(WizardStep step)
	{
		step.setIndex(panel.getWidgetCount());
		panel.add(step);
		panel.showWidget(step.index);
		step.wizard = this;
	}

	public void popLastStep()
	{
		panel.showWidget(panel.getWidgetCount()-2);
		panel.remove(panel.getWidgetCount()-1);
	}

}
